package com.ruoyi.project.system.info.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.info.mapper.RoomInfoMapper;
import com.ruoyi.project.system.info.domain.RoomInfo;
import com.ruoyi.project.system.info.service.IRoomInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 房间信息Service业务层处理
 * 
 * @author yyj
 * @date 2021-05-13
 */
@Service
public class RoomInfoServiceImpl implements IRoomInfoService 
{
    @Autowired
    private RoomInfoMapper roomInfoMapper;

    /**
     * 查询房间信息
     * 
     * @param roomId 房间信息ID
     * @return 房间信息
     */
    @Override
    public RoomInfo selectRoomInfoById(Long roomId)
    {
        return roomInfoMapper.selectRoomInfoById(roomId);
    }

    /**
     * 查询房间信息列表
     * 
     * @param roomInfo 房间信息
     * @return 房间信息
     */
    @Override
    public List<RoomInfo> selectRoomInfoList(RoomInfo roomInfo)
    {
        return roomInfoMapper.selectRoomInfoList(roomInfo);
    }

    /**
     * 新增房间信息
     * 
     * @param roomInfo 房间信息
     * @return 结果
     */
    @Override
    public int insertRoomInfo(RoomInfo roomInfo)
    {
        roomInfo.setCreateTime(DateUtils.getNowDate());
        return roomInfoMapper.insertRoomInfo(roomInfo);
    }

    /**
     * 修改房间信息
     * 
     * @param roomInfo 房间信息
     * @return 结果
     */
    @Override
    public int updateRoomInfo(RoomInfo roomInfo)
    {
        roomInfo.setUpdateTime(DateUtils.getNowDate());
        return roomInfoMapper.updateRoomInfo(roomInfo);
    }

    /**
     * 删除房间信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRoomInfoByIds(String ids)
    {
        return roomInfoMapper.deleteRoomInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除房间信息信息
     * 
     * @param roomId 房间信息ID
     * @return 结果
     */
    @Override
    public int deleteRoomInfoById(Long roomId)
    {
        return roomInfoMapper.deleteRoomInfoById(roomId);
    }
}
